#ifndef SCRIPTSYSTEM_H
#define SCRIPTSYSTEM_H

#include <Pattern.h>
#include <angelscript.h>
#include "angelscript/add_on/scriptstdstring/scriptstdstring.h"
#include <set>
#include "iostream"

using namespace std;

class ScriptSystem:public Pattern::Singleton<ScriptSystem>
{
public:
	ScriptSystem();
	~ScriptSystem();

	void Init();
	int LoadScript(const char* filename,const char* id);
	void unLoadScript(const char* id);
	int CompileScript(const char* id);
	int Start(const char* funcName,int threadid,const char* id);
	
private:

	asIScriptEngine *m_engine;
	asIScriptContext* m_scriptCtx[1];

	void ConfigureEngine();

};

#endif
